(global.webpackJsonp = global.webpackJsonp || []).push([ [ "components/zywPosterSmall/zywPosterSmall" ], {
    "18da": function(t, e, n) {
        function o() {
            this.$createElement, this._self._c;
        }
        var c = [];
        n.d(e, "b", function() {
            return o;
        }), n.d(e, "c", function() {
            return c;
        }), n.d(e, "a", function() {});
    },
    2918: function(t, e, n) {
        n.r(e);
        var o, c = n("e3b9"), s = n.n(c);
        for (o in c) "default" !== o && function(t) {
            n.d(e, t, function() {
                return c[t];
            });
        }(o);
        e.default = s.a;
    },
    aa10: function(t, e, n) {
        n.r(e);
        var o, c = n("18da"), s = n("2918");
        for (o in s) "default" !== o && function(t) {
            n.d(e, t, function() {
                return s[t];
            });
        }(o);
        n("b4ac");
        var i = n("f0c5"), c = Object(i.a)(s.default, c.b, c.c, !1, null, "3a803ec4", null, !1, c.a, void 0);
        e.default = c.exports;
    },
    b4ac: function(t, e, n) {
        var o = n("cb05");
        n.n(o).a;
    },
    cb05: function(t, e, n) {},
    e3b9: function(t, c, s) {
        (function(n) {
            Object.defineProperty(c, "__esModule", {
                value: !0
            }), c.default = void 0;
            var t, o = (t = s("4795")) && t.__esModule ? t : {
                default: t
            };
            function r(t, e, n, o, c, s, i) {
                try {
                    var a = t[s](i), r = a.value;
                } catch (t) {
                    return n(t), 0;
                }
                a.done ? e(r) : Promise.resolve(r).then(o, c);
            }
            var d = "", e = {
                props: {},
                data: function() {
                    return {
                        pic_url: this.$imgUrl,
                        tempImgShow: !1,
                        tempImg: "",
                        cansWidth: 255,
                        cansHeight: 453
                    };
                },
                created: function() {
                    this.ctx = n.createCanvasContext("zwyPoster", this), n.getSystemInfo({
                        success: function(t) {
                          console.log(t)
                        }
                    });
                },
                methods: {
                    sleep: function() {
                        return new Promise(function(t, e) {
                            setTimeout(function() {
                                t();
                            }, 200);
                        });
                    },
                    drawPoster: function(e) {
                        var a, n = this;
                        return a = o.default.mark(function t() {
                            return o.default.wrap(function(t) {
                              console.log(t)
                                for (;;) switch (t.prev = t.next) {
                                  case 0:
                                    return t.next = 2, n.sleep();

                                  case 2:
                                    return console.log("obj", e), t.next = 5, n.drawWebBgTest({
                                        url: e.pic_url,
                                        sLeft: 0,
                                        sTop: 0,
                                        sWidth: 1,
                                        sHeight: 1
                                    });

                                  case 5:
                                    return t.next = 7, n.drawWebBgTest({
                                        url: e.icon,
                                        sLeft: .227,
                                        sTop: .553,
                                        sWidth: .549,
                                        sHeight: .309
                                    });

                                  case 7:
                                    return t.next = 9, n.drawText({
                                        text: "",
                                        sLeft: .5,
                                        sTop: .64,
                                        fontSize: 16,
                                        color: "#FFFFFF"
                                    }).then(function() {
                                        n.saveCans();
                                    });

                                  case 9:
                                  case "end":
                                    console.log(e)
                                    return t.stop();
                                    
                                }
                               
                            }, t);
                            
                        }), function() {
                            var t = this, i = arguments;
                            return new Promise(function(e, n) {
                                var o = a.apply(t, i);
                                function c(t) {
                                    r(o, e, n, c, s, "next", t);
                                }
                                function s(t) {
                                    r(o, e, n, c, s, "throw", t);
                                }
                                c(void 0);
                            });
                        }();
                    },
                    longpress: function() {
                        n.saveImageToPhotosAlbum({
                            filePath: this.tempImg,
                            success: function(t) {
                                n.showToast({
                                    title: "保存相册成功"
                                }), console.log("save success");
                            },
                            fail: function(t) {
                                console.log(t), "saveImageToPhotosAlbum:fail auth deny" == t.errMsg && n.showModal({
                                    title: "您需要授权相册权限",
                                    success: function(t) {
                                        t.confirm && n.openSetting({
                                            success: function(t) {},
                                            fail: function(t) {
                                                console.log(t);
                                            }
                                        });
                                    }
                                });
                            }
                        });
                    },
                    measureText: function(t) {
                        var n = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : 10;
                        return function(t) {
                            t = (t = String(t)).split("");
                            var e = 0;
                            return t.forEach(function(t) {
                                /[a-zA-Z]/.test(t) ? e += 7 : /[0-9]/.test(t) ? e += 5.5 : /\./.test(t) ? e += 2.7 : /-/.test(t) ? e += 3.25 : /[\u4e00-\u9fa5]/.test(t) ? e += 10 : /\(|\)/.test(t) ? e += 3.73 : /\s/.test(t) ? e += 2.5 : /%/.test(t) ? e += 8 : e += 10;
                            }), e * n / 10;
                        }(t);
                    },
                    closeCans: function() {
                        this.$emit("closePost");
                    },
                    drawForm: function(f, u) {
                        var h = this;
                        return new Promise(function(t, e) {
                            for (var n = .9 * h.cansWidth, o = 20 * (f.length + 2) + d, c = {}, s = 0; s < u.length + 1; s++) 0 == s ? c[0] = .1 * h.cansWidth : s == u.length ? c[s] = .9 * h.cansWidth : c[s] = h.cansWidth * u[s].sWidth;
                            for (h.ctx.lineWidth = .5, h.ctx.setFontSize(8), h.ctx.setTextBaseline("top"), s = 0; s <= u.length + 1; s++) h.ctx.moveTo(c[s], d + 20), 
                            h.ctx.lineTo(c[s], o);
                            for (s = 0; s <= f.length + 1; s++) {
                                var i = 20 * (s + 1) + d;
                                if (h.ctx.moveTo(c[0], i), h.ctx.lineTo(n, i), s <= f.length) if (0 == s) for (var a = 0; a < u.length; a++) h.ctx.fillText(u[a].name, c[a] + 8, i + 8); else {
                                    var r, l = s - 1;
                                    for (r in f[l]) h.ctx.fillText(f[l][r], c[r] + 8, i + 8);
                                }
                            }
                            h.ctx.stroke(), h.ctx.draw(!0), setTimeout(function() {
                                d = o + 30, t();
                            }, 50);
                        });
                    },
                    saveCans: function() {
                        console.log("保存");
                        var e = this;
                        n.canvasToTempFilePath({
                            x: 0,
                            y: 0,
                            width: 1.5 * e.cansWidth,
                            height: 1.5 * e.cansHeight,
                            destWidth: 1.5 * e.cansWidth * 2,
                            destHeight: 1.5 * e.cansHeight * 2,
                            canvasId: "zwyPoster",
                            success: function(t) {
                                n.hideLoading(), e.tempImg = t.tempFilePath, setTimeout(function() {
                                    e.tempImgShow = !0;
                                }, 100);
                            },
                            fail: function(t) {
                                n.hideLoading(), console.log(t);
                            }
                        }, this);
                    },
                    circleImg: function(e, s, i, a) {
                        var r = this;
                        return new Promise(function(c, t) {
                            n.downloadFile({
                                url: e,
                                success: function(t) {
                                    console.log(t), s = Math.ceil(r.cansWidth * s), i = Math.ceil(r.cansHeight * i), 
                                    a = 1 < a ? a : Math.ceil(r.cansWidth * a), r.ctx.save();
                                    var e = 2 * a, n = s + a, o = i + a;
                                    r.ctx.arc(n, o, a, 0, 2 * Math.PI), r.ctx.clip(), console.log(t.tempFilePath), r.ctx.drawImage(t.tempFilePath, s, i, e, e), 
                                    r.ctx.restore(), r.ctx.draw(!0), c();
                                },
                                fail: function(t) {
                                    console.log(t), c();
                                }
                            });
                        });
                    },
                    drawPara: function(d) {
                        var x = this;
                        return new Promise(function(t, e) {
                            var n, o = {};
                            if (0 < d.redWord.length) for (var c = 0; c < d.redWord.length; c++) for (var s, i = 0; -1 < (s = d.para.indexOf(d.redWord[c], i)); ) {
                                o[s] = !0;
                                for (var a = 0; a < d.redWord[c].length; a++) o[s + a] = !0;
                                i = s + 1;
                            }
                            x.ctx.font = "normal normal ".concat(d.fontSize, "px sans-serif"), x.ctx.setFillStyle(d.color), 
                            n = "center" == d.sLeft ? x.cansWidth * (.5 - d.sMaxWidth / 2) - d.fontSize : d.sLeft * x.cansWidth - 10;
                            var r = Math.floor(x.cansWidth * d.sMaxWidth);
                            console.log(d.sMaxWidth), console.log(r);
                            for (var l = d.para.split(""), f = "", u = 0, h = 0, c = 0; c < l.length; c++) f += 0 < c ? l[c - 1] : l[0], 
                            r < (h = x.measureText(f, d.fontSize)) && (u++, f = "占", h = x.measureText(f, d.fontSize)), 
                            o[c] && (x.ctx.save(), d.bold && (x.ctx.font = "normal bold ".concat(d.fontSize, "px sans-serif")), 
                            x.ctx.setFillStyle(d.redColor)), x.ctx.fillText(l[c], n + h, d.sTop * x.cansHeight + d.titleHeight * u), 
                            x.ctx.restore();
                            x.ctx.draw(!0), setTimeout(function() {
                                t();
                            }, 50);
                        });
                    },
                    drawBg: function(a) {
                        var r = this;
                        return new Promise(function(t, e) {
                            var n, o = a.sTop <= 1 ? r.cansHeight * a.sTop : a.sTop, c = a.sWidth <= 1 ? r.cansWidth * a.sWidth : a.sWidth, s = a.sHeight <= 1 ? r.cansHeight * a.sHeight : a.sHeight, i = "center" == a.sLeft ? a.sWidth <= 1 ? r.cansWidth * (.5 - a.sWidth / 2) : .5 * r.cansWidth - a.sWidth / 2 : r.cansWidth * a.sLeft;
                            a.r ? (n = a.r, r.ctx.save(), c < 2 * n && (n = c / 2), s < 2 * n && (n = s / 2), 
                            r.ctx.beginPath(), r.ctx.moveTo(i + n, o), r.ctx.arcTo(i + c, o, i + c, o + s, n), 
                            r.ctx.arcTo(i + c, o + s, i, o + s, n), r.ctx.arcTo(i, o + s, i, o, n), r.ctx.arcTo(i, o, i + c, o, n), 
                            r.ctx.closePath(), r.ctx.clip(), r.ctx.drawImage(a.url, i, o, c, s), r.ctx.restore()) : r.ctx.drawImage(a.url, i, o, c, s), 
                            r.ctx.draw(!0), console.log(a.url), setTimeout(function() {
                                t();
                            }, 50);
                        });
                    },
                    drawWebBgTest: function(a) {
                        var r = this;
                        return new Promise(function(i, t) {
                            n.downloadFile({
                                url: a.url,
                                success: function(t) {
                                    var e, n = r.cansHeight * a.sTop, o = r.cansWidth * a.sWidth, c = a.sHeight ? r.cansHeight * a.sHeight : o, s = "center" == a.sLeft ? r.cansWidth * (.5 - a.sWidth / 2) : r.cansWidth * a.sLeft;
                                    a.r ? (e = a.r, r.ctx.save(), r.ctx.beginPath(), r.ctx.arc(s + e, n + e, e, Math.PI, 1.5 * Math.PI), 
                                    r.ctx.moveTo(s + e, n), r.ctx.lineTo(s + o - e, n), r.ctx.lineTo(s + o, n + e), 
                                    r.ctx.arc(s + o - e, n + e, e, 1.5 * Math.PI, 2 * Math.PI), r.ctx.lineTo(s + o, n + c - e), 
                                    r.ctx.lineTo(s + o - e, n + c), r.ctx.arc(s + o - e, n + c - e, e, 0, .5 * Math.PI), 
                                    r.ctx.lineTo(s + e, n + c), r.ctx.lineTo(s, n + c - e), r.ctx.arc(s + e, n + c - e, e, .5 * Math.PI, Math.PI), 
                                    r.ctx.lineTo(s, n + e), r.ctx.lineTo(s + e, n), r.ctx.closePath(), r.ctx.clip(), 
                                    r.ctx.drawImage(t.tempFilePath, s, n, o, c), r.ctx.restore()) : r.ctx.drawImage(t.tempFilePath, s, n, o, c), 
                                    r.ctx.draw(!0), i();
                                }
                            });
                        });
                    },
                    drawText: function(s) {
                        var i = this;
                        return new Promise(function(t, e) {
                            var n, o;
                            if (i.ctx.save(), s.bold && (i.ctx.font = "normal bold ".concat(s.fontSize, "px sans-serif")), 
                            i.ctx.setFillStyle(s.color), i.ctx.setFontSize(s.fontSize), o = "center" == s.sLeft ? (n = i.measureText(s.text, s.fontSize), 
                            .5 * i.cansWidth - n / 2) : s.sLeft <= 1 ? s.sLeft * i.cansWidth : s.sLeft, s.sTop, 
                            s.sTop <= 1 && (s.sTop = s.sTop * i.cansHeight), s.text instanceof Array) {
                                s.lineHeight || (s.lineHeight = s.fontSize + 2), console.log("我是数组", s.text);
                                for (var c = 0; c < s.text.length; c++) i.ctx.fillText(s.text[c], o, s.sTop + s.lineHeight * c);
                            } else console.log("我是字符串", s.text), i.ctx.fillText(s.text, o, s.sTop);
                            i.ctx.draw(!0), i.ctx.restore(), setTimeout(function() {
                                t();
                            }, 50);
                        });
                    }
                }
            };
            c.default = e;
        }).call(this, s("543d").default);
    }
} ]), (global.webpackJsonp = global.webpackJsonp || []).push([ "components/zywPosterSmall/zywPosterSmall-create-component", {
    "components/zywPosterSmall/zywPosterSmall-create-component": function(t, e, n) {
        n("543d").createComponent(n("aa10"));
    }
}, [ [ "components/zywPosterSmall/zywPosterSmall-create-component" ] ] ]);